<template>
	<div id="editModal" class="bill-info">
		<p>合同编号：<strong>{{idenfityList.contractNumber}}</strong></p>
		<h4>个人信息</h4>
		<ul>
			<li><span>姓名：</span>{{idenfityList.name}}</li>
			<li><span>性别：</span>{{idenfityList.sex}}</li>
			<li><span>电话：</span>{{idenfityList.cellphone}}</li>
			<li><span>身份证号码：</span>{{idenfityList.idnumber}}</li>
			<li><span>银行卡号：{{ idenfityList.accNo }}</span></li>
		</ul>
	    <h4>联系人信息</h4>
	    <ul>
	    	<li><span>{{idenfityList.firstContactTypeName}}姓名：</span>{{idenfityList.firstContactName}}</li>
	    	<li><span>{{idenfityList.firstContactTypeName}}电话：</span>{{idenfityList.firstContactCellphone}}<span style="color: red;">(出现次数：{{idenfityList.firstContactCellphoneCount}})</span></li>
	    	<li><span>{{idenfityList.secondContactTypeName}}姓名：</span>{{idenfityList.secondContactName}}</li>
	    	<li><span>{{idenfityList.secondContactTypeName}}电话：</span>{{idenfityList.secondContactCellphone}}<span style="color: red;">（出现次数：{{idenfityList.secondContactCellphoneCount}}）</span></li>
	    </ul>	
	    <h4>照片信息</h4>
	    <ul class="pic-list">
	    	<li>
	    		<p>身份证正面照片</p>
	    		<a :href="idenfityList.frontImageUrl" target="_blank"><img :src="idenfityList.frontImageUrl"></a>
	    	</li>
	    	<li>
	    		<p>身份证背面照片</p>
	    		<a :href="idenfityList.backImageUrl" target="_blank"><img :src="idenfityList.backImageUrl"></a>
	    	</li>
	    	<li>
	    		<p>抓拍照1</p>
	    		<a :href="idenfityList.picUrl1" target="_blank"><img :src="idenfityList.picUrl1"></a>
	    	</li>
	    	<li>
	    		<p>抓拍照2</p>
	    		<a :href="idenfityList.picUrl2" target="_blank"><img :src="idenfityList.picUrl2"></a>
	    	</li>
	    </ul>
	    <h4>通讯录</h4>
	    <ul class="pic-list">
			<Collapse>
	        	<Panel name="1">
	        		通讯录列表
	        		<div slot="content" v-for="item in phoneList">
	        			<p style="float: left;width: 33%;"><label>{{item.userName}}</label><label>{{item.phoneNumber}}</label></p>
	        		</div>
	    		</Panel>
	    	</Collapse>	
	    </ul>
	    <h4>通讯记录</h4>
	    <ul class="pic-list">
			<Collapse>
	        	<Panel name="1">
	        		通讯记录
	        		<div slot="content">
	        		<table class="table table-hover table-condensed">
	        			<thead><tr>
	        				<td>号码</td>
	        				<td>互联网标识</td>
	        				<td>类别标签</td>
	        				<td>号码归属</td>
	        				<td>主叫情况</td>
	        				<td>被叫情况</td>
	        				<td>短信情况</td>
	        			</tr></thead>
	        			<tr v-for="item in callLog">
	        				<td>{{item.phone}}</td>
	        				<td>{{item.phone_info}}</td>
	        				<td>{{item.phone_label}}</td>
	        				<td>{{item.phone_location}}</td>
	        				<td>{{item.call_cnt}}次,{{item.call_seconds}}秒</td>
	        				<td>{{item.called_cnt}}次,{{item.called_seconds}}秒</td>
	        				<td>发送{{item.send_cnt}}条,接收{{item.receive_cnt}}条</td>
	        			</tr>
	        		</table>
	        		</div>
	    		</Panel>
	    	</Collapse>	
	    </ul>
	</div>
</template>

<script>
export default{
	data(){
		return{
			callLog:[],
			oldUserId:-1
		}
	},
	props:['idenfityList','phoneList','userId'],
    methods:{
    	getCallLog(){//通讯记录
			var _this =this,param = {};
			param.userId = _this.userId;
			this.$http.post('/helsinki/admin/risk/getCallLog',param).then(function(res){
	    	if (res.data.errcode == 0) {
	        	_this.callLog = res.data.data.callLog;
	    	}
	    	},function(res){
				_this.$Message.info(res.data.info);
			});
		}
    },
    mounted:function(){
  		
    },
    watch:{
    	userId:function(){
    		if(this.userId != '' && this.userId != this.oldUserId){
    			this.oldUserId = this.userId;
    			this.getCallLog();
    		}
    	}
    }
}
</script>

<style>
</style>